// create delete update find
import BlockModel from './model'
import proxy from '../proxy.js'
import _ from 'lodash'
import assert from 'assert-plus'

function customProxy (method, conditions, fields, options) {
	return proxy(BlockModel, method, conditions, fields, options);
}

const controller = {
	block: async (userId) => {
		return await customProxy('create', {userId: userId})
	},
	unblock: async (userId) => {
		return await customProxy('update', {userId: userId}, {$set: {isDelete: true}}, {multi: true})
	},
	blockCount: async (userId) => {
		return await customProxy('count', {userId: userId, isDelete: false})
	}
};

export default controller;